import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

const store = new Vuex.Store({
    state: {
        tabIndex: 0,
		onlineAudit: null,
		userinfo: {},
		defaultAccount: false,
		kefu: {}
    },
	getters: {
		tabList({onlineAudit}) {
			if (onlineAudit === null) {
				return [
					{
					    pagePath: "/pages/index/index",
					    icon: "home-fill",
					    text: "首页",
					},
					{
					    pagePath: "/pages/member/index",
					    icon: "account-fill",
					    text: "我的",
					},
				]
			} else {
				return [
					{
					    pagePath: "/pages/index/index",
					    icon: "home-fill",
					    text: "首页",
					},
					{
					    pagePath: "/pages/category/index",
					    icon: "coupon-fill",
					    text: onlineAudit ? "我要回收": "我要卖卡",
						button: true
					},
					{
					    pagePath: "/pages/member/index",
					    icon: "account-fill",
					    text: "我的",
					},
				]
				
			}
		}
	}
});
export default store;